import request from '@/utils/request'

// 获取所有叮当
export const all = (userid:string)=>{
  return request({
    url:"/user/orderlist",
    params:{
      userid
    }
  })
}


// 获取某一个时间戳对应的订单
export const one = (userid:string,time:string)=>{
  return request({
    url:"/order/confirmOrder",
    params:{
      userid,time
    }
  })
}


// 修改订单地址
export const updateOrderAddress = (address:{
  userid:string,
  name:string,
  tel:string,
  province:string,
  city:string,
  county:string,
  addressDetail:string,
  time:string,
  [propName:string]:any
})=>{
  return request({
    url:"/order/updateOrderAddress",
    method:'post',
    data:address
  })
}


// 支付并删除购物车选中商品
export const pay = (userid:string)=>{
  return request({
    url:"/order/deleteCartItem",
    params:{
      userid
    }
  })
}